local app = require "app"
local gamelib = require "club.threecard.gamelib"

local M = gamelib.ui.element()

function M:ctor()
    self.res = "club.threecard.slotlib/ui/common.b:last_win"
    self.value = 0
end

function M:on_injected(bind)
    self.lastpay_value.text = "0"
end

function M:set_value(value)
    if self.value == value then
        return
    end
    self.value = value
    self:lazy("on_set_value")
end

function M:on_set_value()
    self.lastpay_value.text = gamelib.utility.digit(self.lastpay_value, 0, self.value, app.i18n.styles.chip2)
end

return M